package org.qpcr.community.device.web;

import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hswebframework.web.authorization.annotation.Authorize;
import org.hswebframework.web.authorization.annotation.Resource;
import org.hswebframework.web.crud.web.reactive.ReactiveCrudController;
import org.hswebframework.web.crud.web.reactive.ReactiveServiceCrudController;
import org.qpcr.community.device.entity.TemperatureCalibrationMetricEntity;
import org.qpcr.community.device.service.TemperatureCalibrationMetricService;
import org.qpcr.community.device.web.request.TemperatureCalibrationMetricEditRequest;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;

import java.util.List;

@RestController
@RequestMapping("/device/temperature-calibration-metric")
@Authorize(ignore = true)
@Resource(id = "temperature-calibration-metric", name = "温度校准指标记录")
@Slf4j
@Tag(name = "温度校准指标记录接口")
@RequiredArgsConstructor
public class TemperatureCalibrationMetricController implements ReactiveServiceCrudController<TemperatureCalibrationMetricEntity, String> {

    @Getter
    private final TemperatureCalibrationMetricService service;

    @PostMapping("edit")
    public Mono<Integer> edit(@RequestBody TemperatureCalibrationMetricEditRequest req) {
        return service.edit(req);
    }
    @GetMapping("list")
    public Mono<List<TemperatureCalibrationMetricEntity>> list() {
        return service.list();
    }
}
